# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse do
  @moduledoc """
  Response for TroubleshootIamPolicy.

  ## Attributes

  *   `access` (*type:* `String.t`, *default:* `nil`) - Indicates whether the member has the specified permission for the specified resource, based on evaluating all of the applicable policies.
  *   `explainedPolicies` (*type:* `list(GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaExplainedPolicy.t)`, *default:* `nil`) - List of IAM policies that were evaluated to check the member's permissions, with annotations to indicate how each policy contributed to the final result. The list of policies can include the policy for the resource itself. It can also include policies that are inherited from higher levels of the resource hierarchy, including the organization, the folder, and the project. To learn more about the resource hierarchy, see https://cloud.google.com/iam/help/resource-hierarchy.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :access => String.t() | nil,
          :explainedPolicies =>
            list(
              GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaExplainedPolicy.t()
            )
            | nil
        }

  field(:access)

  field(:explainedPolicies,
    as:
      GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaExplainedPolicy,
    type: :list
  )
end

defimpl Poison.Decoder,
  for:
    GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse do
  def decode(value, options) do
    GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.PolicyTroubleshooter.V1beta.Model.GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
